package com.example.disruptor.demo.disruptor;

import com.lmax.disruptor.EventHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * 发送消息消费者
 * Created by liunanhua on 2018/7/19.
 */
@Slf4j
public class LongEventSmsConsumer implements EventHandler<LongEvent> {

    @Override
    public void onEvent(LongEvent longEvent, long sequence, boolean endOfBatch) {
        long threadId = Thread.currentThread().getId(); // 获取当前线程id
        log.info("SmsConsumer[" + threadId +"]消费数据：" + longEvent.getValue());
    }

}
